#include "sqlist.h"

int main() {
    SqList l;

    ElemType a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
    CreateList(&l, a, 9);
    PrintList(&l);

    int pos = FindByValue(&l, 10);
    printf("pos = %d\n", pos);

    pos = FindByValue(&l, 1);
    printf("pos = %d\n", pos);

    Status s = ListInsert(&l, 100, 1);
    if (s == TRUE) {
        printf("insert success\n");
    } else {
        printf("insert failed\n");
    }
    PrintList(&l);

    s = ListInsert(&l, 10, 1);
    if (s == TRUE) {
        printf("insert success\n");
    } else {
        printf("insert failed\n");
    }
    PrintList(&l);

    s = ListDelete(&l, 10, &pos);
    if (s == TRUE) {
        printf("delete success\n");
    } else {
        printf("delete failed\n");
    }
    PrintList(&l);

    s = ListlocalDelete(&l, 10);
    if (s == TRUE) {
        printf("delete success\n");
    } else {
        printf("delete failed\n");
    }
    PrintList(&l);

    s = ListDelete(&l, 1, &pos);
    if (s == TRUE) {
        printf("delete success\n");
    } else {
        printf("delete failed\n");
    }
    PrintList(&l);

    return 0;
}